﻿package com.scn.base.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.scn.base.service.ISysFuncService;

@Controller
public class SysFuncController {
	@Autowired
	private ISysFuncService sysFuncService;
	
	/**
	 * 功能描述：菜单功能展示
	 * @param functionName
	 * @param functionId
	 * @param parentId
	 * @param funcs
	 * @return 模型视图
	 */
	@RequestMapping(value="/funcList.html")
	public ModelAndView funcList(String functionName,String functionId,String parentId,String funcs){
		ModelAndView mav=new ModelAndView("/sysrole/roleFuncList");
		if(parentId==null||parentId.trim().equals("")){
			 return mav;
		 }	
		 //获取功能编号
		 String parentId1=parentId.substring(4);
		 List alist=sysFuncService.selectAllFuncByMenu(parentId1);
		 mav.addObject("sysfuncList", alist);
		 mav.addObject("functionName",functionName);
		 mav.addObject("functionId",functionId);
		 mav.addObject("parentId",parentId);
		 mav.addObject("funcs",funcs);
		 return mav;
	}
}
